package start.from.scratch.love.user.manager;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import start.from.scratch.love.user.dto.SaveUserReqDTO;
import start.from.scratch.love.user.entity.UserDO;
import start.from.scratch.love.user.service.impl.UserServiceImpl;

import java.util.List;

@Slf4j
@Service
public class UserManager {

    @Autowired
    UserServiceImpl userService;

    public void saveUser(SaveUserReqDTO input) {
        UserDO userDO = new UserDO();
        userDO.setName(input.getName());
        userService.save(userDO);
    }

    public List<UserDO> list() {
        return userService.list();
    }
}
